#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int* find(int* pa, int* pb, int an, int bn)
{
	int* pta, * ptb;
	pta = pa;
	ptb = pb;
	for (; pta < pa + an; pta++)
	{
		for (ptb = pb; ptb < pb + bn; ptb++)
		{
			if (*pta == *ptb)
				return pta;
		}
	}
	return NULL;
}
int main()
{
	int* p, i;
	int a[] = { 1,2,3,4,5,6,7,8,9,10 };
	int b[] = { 11,12,13,14,15,16,17,18,19,20 };
	printf("The first array is:\n");
	for (i = 0;i < sizeof(a) / sizeof(a[0]);i++)
		printf("%d ", a[i]);
	printf("\n");
	printf("The second array is:\n");
	for (i = 0;i < sizeof(b) / sizeof(b[0]);i++)
		printf("%d ", b[i]);
	printf("\n");
	p = find(a, b, sizeof(a) / sizeof(a[0]), sizeof(b) / sizeof(b[0]));
	if (p != NULL)
		printf("The first common element is:%d\n", *p);
	else
		printf("No common elements!\n");
	return 0;
}